var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        im.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        im.dispose()
    } else {
        if (status === a++) {
            var e = im.getPlayer().getPosition();
            if (Math.abs(e.x + 458) < 100) {
                im.addNumberForQuestInfo(35704, "MazeAlarm", 1);
                im.setNumberForQuestInfo(35704, "set3", 1);
                im.sendNormalTalk_Bottom("已设置警戒石。", 57, 0, false, true);
                im.gainItem(im.getItemId(), -1)
            } else {
                if (Math.abs(e.x - 525) < 100) {
                    im.addNumberForQuestInfo(35704, "MazeAlarm", 1);
                    im.setNumberForQuestInfo(35704, "set2", 1);
                    im.sendNormalTalk_Bottom("已设置警戒石。", 57, 0, false, true);
                    im.gainItem(im.getItemId(), -1)
                } else {
                    if (Math.abs(e.x - 1171) < 100) {
                        im.addNumberForQuestInfo(35704, "MazeAlarm", 1);
                        im.setNumberForQuestInfo(35704, "set1", 1);
                        im.sendNormalTalk_Bottom("已设置警戒石。", 57, 0, false, true);
                        im.gainItem(im.getItemId(), -1)
                    } else {
                        im.playerMessage(-1, "警戒点不在这里。")
                    }
                }
            }
            im.dispose()
        }
    }
};